]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
altTab: Use this._highlighted instead of this._curApp in AppSwitcher
authorJonas Dreßler <verdre@v0yd.nl>
Sun, 29 Apr 2018 23:06:35 +0000 (01:06 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 12 Jan 2022 12:25:19 +0000 (12:25 +0000)
Thanks to the parent class (SwitcherPopup), we already have a property
for the currently highlighted item, let's use it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2097>

js/ui/altTab.js

index dacd9bec6731d7727e1f5aa1af49b6a889caf930..c03c680c3366f68979e6793325e8880a022b4309 100644 (file)
@@ -706,7 +706,6 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
                 this._addIcon(appIcon);
         }
 
-        this._curApp = -1;
         this._altTabPopup = altTabPopup;
         this._mouseTimeOutId = 0;
 
@@ -829,21 +828,20 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
     // show a dim arrow, but show a bright arrow when they are
     // highlighted.
     highlight(n, justOutline) {
-        if (this.icons[this._curApp]) {
-            if (this.icons[this._curApp].cachedWindows.length == 1)
-                this._arrows[this._curApp].hide();
+        if (this.icons[this._highlighted]) {
+            if (this.icons[this._highlighted].cachedWindows.length === 1)
+                this._arrows[this._highlighted].hide();
             else
-                this._arrows[this._curApp].remove_style_pseudo_class('highlighted');
+                this._arrows[this._highlighted].remove_style_pseudo_class('highlighted');
         }
 
         super.highlight(n, justOutline);
-        this._curApp = n;
 
-        if (this._curApp != -1) {
-            if (justOutline && this.icons[this._curApp].cachedWindows.length == 1)
-                this._arrows[this._curApp].show();
+        if (this._highlighted !== -1) {
+            if (justOutline && this.icons[this._highlighted].cachedWindows.length === 1)
+                this._arrows[this._highlighted].show();
             else
-                this._arrows[this._curApp].add_style_pseudo_class('highlighted');
+                this._arrows[this._highlighted].add_style_pseudo_class('highlighted');
         }
     }